#r "nuget:Newtonsoft.Json/13.0.1"
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

Dictionary<string, object> dict = new Dictionary<string, object>();
dict.Add("name","ybs");
dict.Add("age",100);
string json = JsonConvert.SerializeObject(dict);
//json = {"name":"ybs","age":100}

//解析JSON字符串的代码
var dict2 = JsonConvert.DeserializeObject<Dictionary<string,string>>(json);
string name = dict2["name"];
string age = dict2["age"];

Console.WriteLine($"name={name}; age={age}");



